package com.qf.android.huihui.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by lx on 2017/1/5.
 */

public class FragmentAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragments;
    private String [] arr;
    public FragmentAdapter(FragmentManager fm, List<Fragment> fragments, String[] arr) {
        super(fm);
        this.fragments=fragments;
        this.arr=arr;
    }
    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return arr[position];
    }
}
